﻿@model PaginaWeb.Models.MiProducto

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_AdministradorLayout.cshtml";
}

<h2>Crear</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>MiProducto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.nombre)
            @Html.ValidationMessageFor(model => model.nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.modelo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.modelo)
            @Html.ValidationMessageFor(model => model.modelo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.marca)
        </div>
        <div class="editor-field">
       <select id="marca" name="marca_id">
           @using (var db = new PaginaWeb.Models.ContentProducto()) {
               foreach (var ListaDeMarcas in db.marcas) {
                   <option value="@ListaDeMarcas.id">@ListaDeMarcas.nombre</option>
               }
           }
       </select>
            </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.precio)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.precio)
            @Html.ValidationMessageFor(model => model.precio)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.descripcion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.descripcion)
            @Html.ValidationMessageFor(model => model.descripcion)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.url)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.url)
            @Html.ValidationMessageFor(model => model.url)
        </div>
        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}
  <footer>
      <button type="button" class="btn btn-default">
    <a href="~/Home"><font size="4" color="black">Home</font></a>
    </button>
  </footer>
<div>
    <button type="button" class="btn btn-info">
    @Html.ActionLink("Volver a la lista", "Index")
    </button>
</div>

